import java.util.HashSet;
import java.util.Set;

public class Solution893 {
    public int numSpecialEquivGroups(String[] words) {
        Set<String> set=new HashSet<>();
        for (String word : words) {
            char[] chars=word.toCharArray();
            for (int i=0;i<chars.length;i++){
                for (int j=i+1;j<chars.length;j++){
                    if (i%2==j%2 && chars[j]>chars[i]){
                        char t=chars[i];
                        chars[i]=chars[j];
                        chars[j]=t;
                    }
                }
            }
            set.add(String.valueOf(chars));
        }
        return set.size();
    }

    public static void main(String[] args) {
        System.out.println(new Solution893().numSpecialEquivGroups(new String[]{"abcd","cdab","cbad","xyzz","zzxy","zzyx"}));
    }
}
